<?php
require_once '../sub/init.php';
if (!ifint($uid)){
	if($js==1){
		json_exit(array('flag'=>0,'msg'=>'亲，用户不存在~'));
	}else{
		zeaialert('{"title":"亲，用户不存在~","btnt":"我知道了","url":"-1"}');
	}
}
require_once ZEAI.'sub/conn.php';
/*互选开始*/
if($ifhx==1){
	$id=intval($id);$jumpurl = HOST.'/m/huxuan_detail.php?id='.$id;
	if(!iflogin()){
		if($js==1){
			json_exit(array('flag'=>'nologin','msg'=>'亲，请先登录后再来操作哦','jumpurl'=>$jumpurl));
		}else{
			header("Location: ".HOST.'/m/login.php'."?jumpurl=".urlencode($jumpurl));exit;
		}
	}
	$row = $db->ROW(__TBL_HUXUAN__,"bmtj_data,flag,hxtime,json_hxnum","id=".$id." AND flag>0","name");
	if ($row){
		$bmtj_data    = $row['bmtj_data'];$bmtj_data_ARR = explode(',',$bmtj_data);
		$flag         = $row['flag'];
		$hxtime       = $row['hxtime'];
		$json_hxnum   = $row['json_hxnum'];$json_hxnum = json_decode($json_hxnum,true);
		$ifbm         = hx_ifbm($id,$cook_uid);
		if(ADDTIME<$hxtime){
			if($js==1){json_exit(array('flag'=>0,'msg'=>'亲，互选操作还没开始<br>开始时间【'.YmdHis($hxtime).'】'));}else{zeaialert('{"title":"亲，互选操作还没开始<br>开始时间【'.YmdHis($hxtime).'】","btnt":"我知道了","url":"-1"}');}
		}
		if(!$ifbm || $flag==3){
			if($js==1){json_exit(array('flag'=>0,'msg'=>'亲，您已错过报名时间或该活动已结束，下次还有机会哦'));}else{zeaialert('{"title":"亲，您已错过报名时间或该活动已结束，下次还有机会哦","btnt":"我知道了","url":"-1"}');}
		}
		//我的信息
		$cook_uid=intval($cook_uid);
		$row = $db->ROW(__TBL_USER__,"sex,grade,RZ,myinfobfb,photo_f","id=".$cook_uid);
		$cook_sex   = $row['sex'];
		$cook_grade = $row['grade'];
		//她的信息
		$row = $db->ROW(__TBL_USER__,"sex","id=".$uid,"num");
		$sex=$row[0];
		$sex_str = ($sex == 2)?'她':'他';
		//前置条件
		if(in_array('sex',$bmtj_data_ARR)){
			$json=array("ARR"=>array('sex'),"cook_sex"=>$cook_sex,"sex"=>$sex,"js"=>$js);
			Before_TJ(encode_json($json));
		}
		//
		$my_json_hxnum = intval($json_hxnum[$cook_grade]);
	}else{
		if($js==1){
			json_exit(array('flag'=>0,'msg'=>'亲，该活动跑路了~'));
		}else{
			alert('亲，该活动跑路了~','-1');
		}
	}
	$ifhxflag=ifhxflag($id,$uid);
	//我还可以选几次
	$my_hxnum = $db->COUNT(__TBL_HUXUAN_HXU__,"senduid=".$cook_uid." AND fid=".$id);
	//$my_json_hxnum2=$my_json_hxnum-($my_hxnum+1);
	//$my_json_hxnum2_str=($my_json_hxnum2>0)?'<br>您当前还可以选 '.$my_json_hxnum2.' 人':'<br><font class="Cf00">选择人数已达上限 '.$my_json_hxnum.' 人，无法选择</font>';
	
	$my_json_hxnum_ed=$my_json_hxnum-$my_hxnum;
	$my_json_hxnum2_str=($my_json_hxnum_ed>0)?'<br>您当前还可以选 '.$my_json_hxnum_ed.' 人':'<br><font class="Cf00">选择人数已达上限 '.$my_json_hxnum.' 人，无法选择</font>';
	
	//全部级别最多次数字符串
	$urole = json_decode($_ZEAI['urole']);
	$json_hxnum_str='';
	foreach (@$urole as $uv){
		if($uv->f == 0)continue;
		$my_json_hxnum_str=($uv->g==$cook_grade)?'<font class="Cf00">我</font>':'　';
		$json_hxnum_str.='【'.$uv->t.' '.$json_hxnum[$uv->g].' 人】'.$my_json_hxnum_str.'<br>';
	}
	$json_hxnum_str .= '<br><a href="'.mHref('vip').'?jumpurl='.urlencode($jumpurl).'" class="ico ifhx_vipsjA">&#xe6ab; 我要升级VIP</a>　';
	//
	if($submitok=='ajax_hx_add'){
		if($my_json_hxnum==0)json_exit(array('flag'=>0,'msg'=>'您所在会员级别不能互选'));
		if($my_hxnum>=$my_json_hxnum){
			if($js==1){
				json_exit(array('flag'=>0,'msg'=>'亲，您本次活动最多只能选择'.$my_json_hxnum.'人'));
			}else{
				alert('亲，您本次活动最多只能选择'.$my_json_hxnum.'人','-1');
			}
		}
		if($ifhxflag){
			if($js==1){json_exit(array('flag'=>0,'msg'=>'亲，您已经选过'.$sex_str.'了哦'));}else{zeaialert('{"title":"亲，您已经选过'.$sex_str.'了哦","btnt":"我知道了","url":"-1"}');}
		}
		$db->query("INSERT INTO ".__TBL_HUXUAN_HXU__."  (fid,addtime,uid,senduid) VALUES ($id,".ADDTIME.",$uid,$cook_uid)");
		$my_json_hxnum=$my_json_hxnum-1;
		$my_json_hxnum_str=($my_json_hxnum>0)?'<br>您还可以再选'.$my_json_hxnum2.'人，请认真选择哦':'';
		json_exit(array('flag'=>1,'msg'=>'选择成功，请返回选择其'.$sex_str.'嘉宾'.$my_json_hxnum_str));
	}
}
/*互选结束*/
require_once ZEAI.'cache/config_index.php';
require_once ZEAI.'cache/config_vip.php';
$switch = json_decode($_ZEAI['switch'],true);
$qx_1price = floatval($_VIP['qx_1price']);
$jumpurl = HOST.'/m/hongniang_u.php?uid='.$uid;
$kf_tel=dataIO($_ZEAI['kf_tel'],'out');$kf_mob=dataIO($_ZEAI['kf_mob'],'out');$kf_wxpic=dataIO($_ZEAI['kf_wxpic'],'out');
//我的信息
$cook_uid=intval($cook_uid);
if(ifint($cook_uid)){
	$row = $db->ROW(__TBL_USER__,"sex,grade,photo_s,photo_f,ifadm,admid,money","id=".$cook_uid);
	$cook_grade = $row['grade'];
	$cook_photo_s   = $row['photo_s'];
	$cook_photo_f   = intval($row['photo_f']);
	$cook_ifadm     = intval($row['ifadm']);
	$cook_admid     = intval($row['admid']);
	$cook_sex       = intval($row['sex']);
	$cook_qxnum     = intval($row['crm_qxnum']);
	$cook_money     = $row['money'];
}
/*用户读库*/
$fields = "dataflag,photo_f,grade,photo_ifshow,parent,admid,mate_other,flag";
$fields.=",".udata_arr('all','userF').',areatitle,area2title,'.get_mate_fld('list');
$row = $db->ROW(__TBL_USER__,$fields,"(flag=1 OR flag=-2) AND id=".$uid);
if ($row){
	$dataflag   = $row['dataflag'];
	$sex        = $row['sex'];
	$grade      = $row['grade'];
	$mate_other = dataIO($row['mate_other'],'out');
	$Urow       = $row;
}else{
	zeaialert('{"title":"用户不存在","btnt":"我知道了","url":"-1"}');
}
/*同性*/
if($cook_sex==$sex && $t!='crm'){
	if($js==1){
		json_exit(array('flag'=>0,'msg'=>'同性别不能操作哦＾_＾'));
	}else{
		zeaialert('{"title":"同性别不能操作哦＾_＾","btnt":"我知道了","url":"-1"}');
	}
}
/*开始*/
$form_data=udata_arr('basic_ext');
$form_data_num=intval(@count($form_data));$form_data_num_end=$form_data_num-5;
if (!is_array($form_data))zeaialert('{"title":"暂无资料选项","btnt":"我知道了","url":"-1"}');
require_once ZEAI.'cache/udata.php';
function udata_title($data_data,$f,$kind='') {foreach($data_data as $v){if($v['fieldname'] == $f)if($kind=='subkind'){return $v['subkind'];}else{return $v['title'];}}}
$sex     = $row['sex'];
$photo_s = $row['photo_s'];
$photo_f = $row['photo_f'];
$uflag   = $row['flag'];
$photo_ifshow= $row['photo_ifshow'];
$ifadm   = $row['ifadm'];
$admid   = $row['admid'];
$birthday   = $row['birthday'];
$areatitle  = dataIO($row['areatitle'],'out');
$area2title = dataIO($row['area2title'],'out');

$sex_str = ($sex == 2)?'她':'他';
$parent  = (empty($row['parent']))?1:$row['parent'];
if($ifadm==1){
	$parent_str = '<div class="bangadm">工作人员</div>';
}else{
	$parent_str = udata('parent',$parent);
}
/*照片权限*/
if (!empty($photo_s) && $photo_f == 1){
	$photo_s_url = UP.$photo_s;
	$photo_m_url = smb($photo_s_url,'m');
	$photo_b_url = smb($photo_s_url,'b');
	$photo_blur_url = smb($photo_s_url,'blur');
}else{
	$photo_s_url    = RES.'photo_m'.$sex.'.png';
	$photo_m_url    = RES.'photo_m'.$sex.'.png';
	$photo_blur_url = RES.'m/img/photo_blur.jpg';
}
$ifblur=0;$lockstr='';
$photo_flag = photo_s_out('{"sex":"'.$sex.'","photo_s":"'.$photo_s.'","photo_f":"'.$photo_f.'","photo_ifshow":"'.$photo_ifshow.'","uflag":"'.$uflag.'","outkind":"flag"}');
if(!$photo_flag){
	$photo_s_url = smb($photo_s_url,'blur');
	$photo_m_url = $photo_s_url;
	$photo_b_url = $photo_s_url;
	$ifblur=1;
}
if(empty($photo_ifshow) && $ifblur==0 && $t!='crm'){
	$photo_s_url = smb($photo_s_url,'blur');
	$photo_m_url =$photo_s_url;
	$photo_b_url = $photo_s_url;
}
$photo_m_str = '<img src="'.$photo_m_url.'">';
/*照片权限 END*/
/*地区分享说明处理*/
$sext=($sex==1)?'【帅哥求脱单】':'【美女求脱单】';
$areatitleArr = explode(' ',$areatitle);
$areatitle2=$areatitleArr[1];
$areatitle3=$areatitleArr[2];
$areatitle3=(empty($areatitle3))?$areatitle2:$areatitle3;
$age=getage($birthday);
$age_str=($age>0)?$age.'岁':'';
$share_u_title = $sext.$nickname.'·'.$age_str.'.'.$areatitle3;
$share_u_desc  = trimhtml($_INDEX['indexContent']);	
$area_s_title = explode(' ',$areatitle);
$area_s_title1 = $area_s_title[1];
$area_s_title2 = $area_s_title[2];
$area_s_title  = $area_s_title1.$area_s_title2;
$area_s_title2 = explode(' ',$area2title);
$area_s_title2 = $area_s_title2[2].$area_s_title2[3];
$db->query("UPDATE ".__TBL_USER__." SET click=click+1 WHERE id=".$uid);
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $share_u_title.$_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/u.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/hongniang.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php if($ifhx==1){?>
<script>var my_json_hxnum=<?php echo $my_json_hxnum;?>,sex_str='<?php echo $sex_str;?>',my_json_hxnum2_str='<?php echo $my_json_hxnum2_str;?>',json_hxnum_str='<?php echo $json_hxnum_str;?>';</script>
<script src="<?php echo RES;?>m/js/huxuan_detail.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
<?php if (is_weixin()){
	require_once ZEAI."api/weixin/jssdk.php";
	$share_u_title = $share_u_title.'.'.$_ZEAI['siteName'];?>
	<script src="<?php echo RES;?>jweixin-1.2.0.js"></script>
	<script>wx.config({debug:false,appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',jsApiList:['hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo']});
	var share_u_title = '<?php echo $share_u_title; ?>',share_u_desc='<?php echo $share_u_desc; ?>',share_u_link='<?php echo $jumpurl; ?>',share_u_imgurl='<?php echo $photo_s_url; ?>';
	wx.ready(function () {
		wx.onMenuShareAppMessage({title:share_u_title,desc:share_u_desc,link:share_u_link,imgUrl:share_u_imgurl});
		wx.onMenuShareTimeline({title:share_u_title,desc:share_u_desc,link:share_u_link,imgUrl:share_u_imgurl});
	});
    </script>
<?php }?>
<style>
#backtop a{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.btmKefuBtn,.hongniang_u h3 b,.hongniang_u_btm a{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
#hnbox dl dt div.admid .hnpic b{background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.8)}
#hnbox dl{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.hongniang_u_btm a{box-shadow:0 .3rem .8rem rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.4)}
body{background-color:#f5f5f5}
.hongniang_utop{background:url("<?php echo $photo_blur_url; ?>")top center / cover no-repeat}
.blank{height:10rem}
.ifhx #hn{background-color:#fff;color:<?php echo $_ZEAI['mob_mbcolor'];?>;border:<?php echo $_ZEAI['mob_mbcolor'];?> 1px solid;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.mate_other{padding:1rem 5%;text-align:left;}
.mate_other font{color:#999;margin-right:1rem;line-height:200%}
<?php
if ($_ZEAI['m_mb']==2){
	$mini_class='top_mini4';
	echo '.TRnav_btn i{color:'.$_ZEAI['mob_mbcolor'].'}';
}else{
	$mini_class='top_mini4 zeaibg bgcolor';
}?>
</style>
</head><body>
<?php
$mini_title='详细资料';
//$mini_class='top_mini4 zeaibg bgcolor';
//$mini_L = '<em onClick="zeai.back()"><i class="ico" >&#xeaca;</i></em>';
require_once ZEAI.'m/top_mini.php';
?>
<div class="hongniang_utop"><div class="photo_m" id="photo_m"><?php echo $photo_m_str;?><div class="parent"><?php echo $parent_str;?></div></div></div>
<div class="u_data hongniang_u">
	<dl><dt><?php echo ($ifhx==1)?'嘉宾编号':'ID';?></dt><dd><?php echo $uid;?></dd></dl>
	<?php
	$n=1;
	foreach($form_data as $F){
		$F=$F['fieldname'];
		if($F=='parent' || $F=='photo_s' || $F=='aboutus' || $F=='nickname' || $F=='companyname')continue;
		$subkind = udata_title($form_data,$F,'subkind');
		$T = udata_title($form_data,$F);
		$DATA = $Urow[$F];
		$DATA_str = '';
		//控件类型
		switch ($subkind) {//1:文本,2:单选,3:复选,4:区间,5:特殊
			case 1:$DATA = trimhtml(dataIO($DATA,'wx'),'keep_rn');$DATA_str = $DATA;break;
			case 2:$DATA_str = udata($F,$DATA);break;
			case 3:$DATA_str = udata($F,$DATA);break;
			case 4:$DATA_str = udata($F,$DATA);break;
		}
		//控件类型-特殊
		switch ($F) {
			case 'birthday':
				$DATA_str = $DATA;
			break;
			case 'areaid':
				$DATA_str=(!empty($Urow['areatitle']))?$Urow['areatitle']:$DATA_str;
			break;
			case 'area2id':
				$DATA_str=(!empty($Urow['area2title']))?$Urow['area2title']:$DATA_str;
			break;
			case 'aboutus':$class='txtarea';break;
		}

		//$dl0=($n % 10==0 || $form_data_num_end==$n)?' dl0':''; class="'.$dl0.'"
		if(!empty($DATA_str))echo '<dl><dt>'.$T.'</dt><dd>'.$DATA_str.'</dd></dl>';
		$n++;
	}?>
</div>
<?php
//择偶要求
$mate_diy = explode(',',$_ZEAI['mate_diy']);
if (count($mate_diy) >= 1 && is_array($mate_diy)){
	$mate_li_out='';
	foreach ($mate_diy as $F) {
		$ext = mate_diy_par($F,'ext');
		switch ($ext) {
			case 'radio':
				$D     = intval($Urow['mate_'.$F]);
				$D_str = (ifint($D))?udata($F,$D):'';
				if(ifint($D)){
					$D_str = udata($F,$D);
					//switch ($F) {
					//	case 'edu':$D_str = '最低'.$D_str;break;
					//	case 'pay':$D_str = '最低月薪'.$D_str;break;
					//}
				}else{$D_str='';}
			break;
			case 'radiorange':
				$D1     = intval($Urow['mate_'.$F.'1']);
				$D2     = intval($Urow['mate_'.$F.'2']);
				$D      = $D1.','.$D2;
				$dwarr  = json_decode($_UDATA[$F],true);$dw = $dwarr['dw'];
				$D_str  = (ifint($D1) || ifint($D2))?mateset_out($D1,$D2,$dw):'';
				$D_str  = str_replace("不限","",$D_str);
			break;
			case 'checkbox':
				$D     = $Urow['mate_'.$F];
				$D_str = (!empty($D))?udata($F,$D):'';
			break;
			case 'area':
				switch ($F) {
					case 'areaid':
						$D_t = str_replace("不限","",$Urow['mate_areatitle']);
						$D_str = (!empty($D_t))?$D_t:'';
					break;
					case 'areaid2':
						$D_t = str_replace("不限","",$Urow['mate_areatitle2']);
						$D_str = (!empty($D_t))?$D_t:'';
					break;
				}
			break;
		}
		if(!empty($D_str))$mate_li_out.='<dl><dt>'.mate_diy_par($F,'title').'</dt><dd>'.$D_str.'</dd></dl>';
	}
}?>
<?php if(!empty($mate_li_out)){?>
<div class="u_data hongniang_u" style="margin-top:10px;padding-bottom:10px">
	<h3>择偶要求<b></b></h3>
	<?php echo $mate_li_out;if(!empty($mate_other)){?><div class="mate_other"><font>其他要求</font><?php echo $mate_other;?></div><?php }?>
</div>
<?php }
//红娘牵线
if(ifint($admid))$_ZEAI['homekefuewm']=0;
if(@in_array('hn',$navarr) && $cook_uid!=$uid && ifint($cook_uid) && $_ZEAI['homekefuewm']!=1){
	$cook_qxnum_ed       = $db->COUNT(__TBL_QIANXIAN__," (senduid=".$cook_uid." OR uid=".$cook_uid.") ");
	$cook_qxnum_ed_herme = $db->COUNT(__TBL_QIANXIAN__," (senduid=".$cook_uid." AND uid=".$uid." OR senduid=".$uid." AND uid=".$cook_uid.") ");

	$rowhn = $db->ROW(__TBL_CRM_HN__,"id,truename,ewm,path_s","flag=1 AND ewm<>'' AND ifwebshow=1 AND id=".intval($cook_admid)." ORDER BY rand() LIMIT 1",'name');
	if (!$rowhn){
		$rowhn = $db->ROW(__TBL_CRM_HN__,"id,truename,ewm,path_s","flag=1 AND ewm<>'' AND ifwebshow=1 AND id=".$admid." ORDER BY rand() LIMIT 1",'name');
		if (!$rowhn)$rowhn = $db->ROW(__TBL_CRM_HN__,"id,truename,ewm,path_s","flag=1 AND ewm<>'' AND ifwebshow=1 ORDER BY rand() LIMIT 1",'name');
	}
	if ($rowhn){
		$hn_id       = $rowhn['id'];
		$hn_truename = dataIO($rowhn['truename'],'out');
		$hn_ewm      = $rowhn['ewm'];
		$path_s      = $rowhn['path_s'];
		$path_s_url  = (!empty($path_s))?UP.$path_s:RES.'m/img/hnico.jpg';
		$hn_ewm_url  = UP.$hn_ewm;
	}else{
		$hn_id = 0;
		$path_s_url = RES.'photo_m.png';
		$hn_ewm_url = UP.dataIO($_ZEAI['kf_wxpic'],'out');
	}
	if (!empty($cook_photo_s) && $cook_photo_f == 1){
		$cook_photo_m_url = UP.smb($cook_photo_s,'m');
	}else{
		$cook_photo_m_url = RES.'photo_m'.$cook_sex.'.png';
	}
	if($cook_qxnum_ed_herme>0){
		$qxbtn_str='<i class="ico">&#xe61b;</i> 牵线中';
		$qxbtn_cls='HUANG';
	}else{
		$qxbtn_str='委托【'.$hn_truename.'】牵线';
		$qxbtn_cls='zeaibg';
	}
	?>
    <script>var winh=<?php echo (is_weixin())?30.5:37.5;?>,qx_1price_C='<?php if($cook_qxnum==0 && $qx_1price>0)echo dataIO( $_VIP['qx_1price_C'],'out');?>';</script>
	<div id="hnbox">
		<dl><dt>
            <div class="senduid"><img src="<?php echo $cook_photo_m_url;?>" /><font class="zeaicolor">我<?php if (ifint($cook_uid)){?><span>ID：<?php echo $cook_uid;?></span><?php }?></font></div>
            <div class="admid"><em class="hnpic"><img src="<?php echo $path_s_url;?>" /><b>红娘</b></em><font class="zeaicolor"><?php echo $hn_truename;?></font></div>
            <div class="uid"><img src="<?php echo $photo_m_url;?>" /><font class="zeaicolor"><?php echo $nickname;?><span>ID：<?php echo $uid;?></span></font></div>           
			</dt><dd><img src="<?php echo $hn_ewm_url; ?>"><h6 class="C999">长按二维码加红娘微信</h6><a href="<?php echo a('{"kind":"my_hongniang"}');?>?t=qx&jumpurl=<?php echo $jumpurl;?>">我的牵线记录<?php if($cook_qxnum_ed>0)echo '('.$cook_qxnum_ed.')';?></a></dd>
		</dl>
		<button type="button" class="btn size4 yuan <?php echo $qxbtn_cls;?> " id="qx_btnFn"<?php if ($cook_qxnum_ed_herme == 0){?>onClick="qx_btnFn(<?php echo $uid;?>,<?php echo $hn_id;?>,'<?php echo $hn_truename;?>');"<?php }?>><?php echo $qxbtn_str;?></button>
	</div>
	<?php
	if($cook_qxnum==0 && $qx_1price>0){
		$jump_url = $jumpurl;
		$money = $qx_1price;
		$kind  = 23;
		echo '<input type="hidden" id="money" value="'.$money.'">';
		echo '<input type="hidden" id="qx_admid" value="'.$hn_id.'">';
		echo '<input type="hidden" id="qx_uid" value="'.$uid.'">';?>
		<!--<a id="nextbtn">确认支付</a>-->
		<?php require_once 'my_pay.php';
	}
}
if ($ifhx == 1){?>
    <div class="hongniang_u_btm ifhx">
        <?php if ($ifhxflag){?>
        	<a id="hx" class="ed"><i class="ico">&#xe60f; 已选择</i></a>
        <?php }else{ ?>
        	<a id="hx" onClick="hxFn(<?php echo $id;?>,<?php echo $uid;?>)"><i class="ico">&#xe8d5; 选<?php echo $sex_str;?></i></a>
        <?php }?>
        <a onclick="<?php echo ($_ZEAI['homekefuewm']==1)?'hnFn2()':'hnFn()';?>"><i class="ico">&#xe613; 牵线</i></a>
    </div>
    <style>#backtop{bottom:80px}#backtop a{background-color:#fff;color:<?php echo $_ZEAI['mob_mbcolor'];?>}</style>
<?php }else{ ?>
    <?php if ($t != 'crm'){?><div class="hongniang_u_btm"><a <?php if (ifint($cook_uid)){echo ($_ZEAI['homekefuewm']==1)?'onclick="hnFn2();"':'onclick="hnFn();"';}else{echo 'href="'.mHref('login').'?jumpurl='.$jumpurl.'"';}?>><i class="ico">&#xe62f; 我想认识<?php echo $sex_str;?></i></a></div><?php }?>
<?php }?>
<?php if ($_ZEAI['homekefuewm']==1){?>
<div class="lx_kefu" id="homekefuewm">
    <?php if (!empty($kf_wxpic) ){?><img src="<?php echo UP.$kf_wxpic;?>"><font>长按二维码加客服微信</font><br /><br /><?php }?>
    <?php if (!empty($kf_tel)){?>
        <i class="ico zeaicolor">&#xe68b;</i> <a href="tel:<?php echo $kf_tel;?>" class="zeaicolor"><?php echo $kf_tel;?> (点击拔打)</a>
    <?php }else{?>
        <?php if (!empty($kf_mob)){?><i class="ico zeaicolor">&#xe627;</i> <a href="tel:<?php echo $kf_mob;?>" class="zeaicolor"><?php echo $kf_mob;?> (点击拔打)</a><?php }?>
    <?php }?>
</div>
<?php }?>
<div id="backtop"><a href="#top" id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php require_once ZEAI.'m/TRnav.php';?>
<script>
var browser='<?php echo browser();?>';
document.body.onscroll = backtop_alone;
<?php 
if (!empty($photo_s) && $photo_f == 1){?>
	var photo_b = '<?php echo $photo_b_url;?>';
	photo_m.onclick=photo_mFn;<?php
}
if(@in_array('hn',$navarr) && $cook_uid!=$uid && ifint($cook_uid) && $t != 'crm'){?>
function hnFn(){ZeaiM.div_up({obj:hnbox,h:36});}
function hnFn2(){ZeaiM.div_up({obj:homekefuewm,h:24});}

/*
function qx_btnFn(uid,admid){
	zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_qx',uid:uid,admid:admid}},function(e){var rs=zeai.jsoneval(e);
		if(rs.flag==1){
			zeai.msg(rs.msg,{time:3});
			div_up_close.click();
			o('qx_btnFn').html('<i class="ico">&#xe61b;</i> 牵线中');o('qx_btnFn').removeClass('zeaibg');o('qx_btnFn').addClass('HUANG');
		}else{
			ZeaiM.sorry(rs);
		}
	});
}
*/

function qx_btnFn(uid,admid,admname){
	var str=(!zeai.empty(qx_1price_C))?qx_1price_C:'';
	zeai.alertplus({title:'确定委托【'+admname+'】牵线么？',content:str,title1:'取消',title2:'确定',
		fn1:function(){zeai.alertplus(0);},
		fn2:function(){zeai.alertplus(0);
			zeai.ajax({url:HOST+'/m/u'+zeai.extname,js:1,data:{submitok:'ajax_qx',uid:uid,admid:admid}},function(e){var rs=zeai.jsoneval(e);
				if(rs.flag==1){
					zeai.msg(rs.msg,{time:4});
					setTimeout(function(){location.reload(true);},4000);
				}else if(rs.flag=='qx_1price'){
					ZeaiM.div_up({obj:czbox,h:winh});
				}else{
					ZeaiM.sorry(rs);
				}
			});
		}
	});
}



<?php }?>
function photo_mFn(){ZeaiM.piczoom({browser:browser,b:photo_b,list:[photo_b]});}
</script>
<div class="blank"></div></body></html><?php 
function hx_ifbm($id,$cook_uid) {
	global $db;
	if(!ifint($id) || !ifint($cook_uid) )return false;
	if($db->ROW(__TBL_HUXUAN_BMU__,"id","fid=".$id." AND uid=".$cook_uid))return true;
	return false;
}		
function ifhxflag($id,$uid) {
	global $db,$cook_uid;
	if(!ifint($id) || !ifint($cook_uid) || !ifint($uid) )return false;
	if($db->ROW(__TBL_HUXUAN_HXU__,"id","senduid=".$cook_uid." AND fid=".$id." AND uid=".$uid))return true;
	return false;
}		
?>